//
//  JGUserManagementContentView.m
//  JGRider
//
//  Created by 单启志 on 2018/1/31.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGUserManagementContentView.h"
@interface JGUserManagementContentView()

@property (weak, nonatomic) IBOutlet UIImageView *iconImageV;//头像

@property (weak, nonatomic) IBOutlet UITextField *nameTextField;//姓名
@property (weak, nonatomic) IBOutlet UIImageView *genderImageV;//性别头像

@property (weak, nonatomic) IBOutlet UILabel *genderLab;//性别

@property (weak, nonatomic) IBOutlet UILabel *birthdayLab;//生日


@end

@implementation JGUserManagementContentView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self=[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
        self.frame=frame;

    }
    return self;
}

-(void)awakeFromNib{

    [super awakeFromNib];
    
}


#pragma mark - event response
//更改头像
- (IBAction)onChangeIconBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(contentViewChangeIconEvent)]) {
        [self.delegate contentViewChangeIconEvent];
    }
}

//更改性别
- (IBAction)onChangeGenderBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(contentViewChangeGenderEvent)]) {
        [self.delegate contentViewChangeGenderEvent];
    }
}

//更改生日
- (IBAction)onChangeBirthdayBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(contentViewChangeBirthdayEvent)]) {
        [self.delegate contentViewChangeBirthdayEvent];
    }
}
//修改密码
- (IBAction)onChangePwdBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(contentViewChangePwdEvent)]) {
        [self.delegate contentViewChangePwdEvent];
    }
}

//退出登录
- (IBAction)onLogoutBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(contentViewLogoutEvent)]) {
        [self.delegate contentViewLogoutEvent];
    }
}

#pragma mark - setters
-(void)setSelectImage:(UIImage *)selectImage{

    _selectImage=selectImage;
    self.iconImageV.image=selectImage;
    [self layoutSubviews];
}

-(void)layoutSubviews{

    [super layoutSubviews];
    self.iconImageV.layer.masksToBounds=YES;
    self.iconImageV.layer.cornerRadius=AdaptedWidth(53)/2.0;

}


@end
